package com.zhihaoliang.room.data

import androidx.room.*

/**
 * @author 支豪亮
 * @date 2023/1/31 14:44
 * @des 展示对象嵌入
 */

@Entity(tableName = "user_address")
class UserAd(
     val firstName: String?, @Embedded val address: Address?
){
    @PrimaryKey(autoGenerate = true) var id: Int =0
}


data class Address(
    val street: String?,
    val state: String?,
    val city: String?,
    @ColumnInfo(name = "post_code") val postCode: Int
)


@Dao
interface UserAdDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertAll(list:List<UserAd>)
}